/*
 *  this file store the clusters of the questions
 *
 */
#ifndef Cluster_H_
#define Cluster_H_
#include "header.h"
class Cluster {
    public:
        Cluster();
        //clusterIdMapFile give the clusterId of every questions
        //clusterFile give the questions of every clusterId
        Cluster(const char *clusterIdMapFile, const char* clusterFile, int docNum);
        ~Cluster();
        void load(const char *clusterIdMapFile, const char* clusterFile, int docNum);
        inline int getClusterId(int qId)
        { return this->qIdClusterIdMap[qId]; }
        inline vector<int>& getClusterById(int clusterId)
        { return this->clusters[clusterId]; }
        inline vector<int>& getClusterByqId(int qId)
        { return this->clusters[getClusterId(qId)]; }
    private:
        vector<int> qIdClusterIdMap;
        vector< vector<int> > clusters;
        int docNum;
};

#endif //Cluster_H_
